<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title></title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <link rel="stylesheet" type="text/css" href="../resources/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="../resources/css/bootstrap-datetimepicker.min.css">
    <link rel="stylesheet" href="../resources/css/grumble.css">

    <script type="text/javascript" src="../resources/scripts/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="../resources/scripts/bootstrap.js"></script>
    <script type="text/javascript" src="../resources/scripts/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="../resources/scripts/bootstrap-datetimepicker.zh-CN.js"></script>
    <script type="text/javascript" src="../resources/scripts/jquery.grumble.min.js"></script>
    <script type="text/javascript" src="../resources/scripts/zhBase.js"></script>
    <script type="text/javascript" src="../resources/scripts/zhForm.js"></script>
    <script>
        $(function () {

            /**
             * 提交后的响应函数
             * @param data 服务器返回
             */
            function deal(data) {
                if("1"==data.status){
                    alert("保存成功");
                    window.location.href="/sys/apply/index.do";
                }
                else if("-1"==data.status)
                {
                    alert("该申请已经审核成功，不能更改信息");
                    window.location.href="/sys/apply/index.do";
                }
                else{
                    alert("保存失败");
                }
            }

            var zf = new zhForm($("#formId"));
            $("#btnid").click(function () {
                var isSuccess = zf.verify();
                if (isSuccess) {
                    zf.submitForm(deal);
                }
            });

            //初始化时间插件
            $('.form_datetime').datetimepicker({
                format: 'yyyy-mm-dd',
                language: 'zh-CN',
                weekStart: 1,
                todayBtn: 1,
                autoclose: 1,
                todayHighlight: 1,
                startView: 2,
                minView: 2,
                forceParse: 0
            }).click(function () {
                $(this).val("");
            });
        });
    </script>
</head>
<BODY class="mian_bg">
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
    <TR height=28>
        <TD class="addr_td">&nbsp;&nbsp;<img src="/sys/resources/images/addr_icon.png">&nbsp;当前位置: 活动申请>编辑申请</TD>
    </TR>
    <TR>
        <TD bgColor=#7ca600 height=1></TD>
    </TR>
    <TR>
        <TD bgColor=#8ebe00 height=1></TD>
    </TR>
</TABLE>

<div class="container">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">编辑申请</h3>
        </div>
        <div class="panel-body">
            <form action="/sys/apply/editData.do" id="formId" class="form-horizontal" role="form">
                <input name="id" type="hidden" value="${obj.id}">
                <div class="row">
                    <div class="col-xs-8">
                        <div class="form-group">
                            <label for="title" class="col-sm-3 control-label">活动名称</label>

                            <div class="col-sm-9">
                                <input name="title" value="${obj.title}" type="text" notNull="true" class="form-control" id="title" placeholder="活动名称">
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-xs-8">
                        <div class="form-group">
                            <label for="money" class="col-sm-3 control-label">活动经费(元)</label>

                            <div class="col-sm-9">
                                <input name="money" value="${obj.money}" type="text" isNumber="true" class="form-control" id="money"
                                       placeholder="活动经费">
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-xs-8">
                        <div class="form-group">
                            <label for="timeBegin" class="col-sm-3 control-label">活动开始时间</label>
                            <div class="col-sm-9">
                                <input type="text" value="${obj.timebegin}" name="timeBegin" id="timeBegin" readonly class="form_datetime form-control">

                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-8">
                        <div class="form-group">
                            <label for="timeEnd" class="col-sm-3 control-label">活动结束时间</label>
                            <div class="col-sm-9">
                                <input type="text" value="${obj.timeend}" name="timeEnd" id="timeEnd" readonly class="form_datetime form-control">

                            </div>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-xs-12">
                        <div class="form-group">
                            <label for="meaning" class="col-sm-2 control-label">活动意义</label>

                            <div class="col-sm-9">
                                <textarea name="meaning" class="form-control" notNull="true" id="meaning" rows="3">${obj.meaning}</textarea>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <div class="form-group">
                            <label for="content" class="col-sm-2 control-label">活动简介</label>

                            <div class="col-sm-9">
                                <textarea name="content" class="form-control" notNull="true" id="content" rows="3">${obj.content}</textarea>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-xs-2">
                    </div>
                    <div class="col-xs-4">
                        <button type="button" id="btnid" class="btn btn-success btn-block">提交</button>
                    </div>
                    <div class="col-xs-2">
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>

